import { createRouter, createWebHistory } from 'vue-router'
import Admin from '../views/admin/Admin.vue'
import AdminIndex from '../views/admin/Index.vue'
import User1 from '../views/admin/User1.vue'
import PosList from '../views/admin/PosList.vue'
import PosReview from '../views/admin/PosReview.vue'
import Company1 from '../views/admin/Company1.vue'
import Report from '../views/admin/Report.vue'

import Login from '../views/Login.vue'
import Register from '../views/Register.vue'

import HrLoyout from '../views/hr/LoyoutHr.vue'
import Hmenu1 from '../views/hr/ResumeManage.vue'
import PosManage from '../views/hr/PosManage.vue'
import Hmenu3 from '../views/hr/Hmenu3.vue'
import Hmenu4 from '../views/hr/Hmenu4.vue'

import LayoutUser from '../views/jobseeker/LayoutJobSeeker.vue'
import Umenu1 from '../views/jobseeker/Index.vue'
import Umenu2 from '../views/jobseeker/Search.vue'
import Umenu3 from '../views/jobseeker/Umenu3.vue'
import Umenu4 from '../views/jobseeker/Umenu4.vue'
import Umenu5 from '../views/jobseeker/Umenu5.vue'
import PersonalCenter from '../views/jobseeker/PersonalCenter.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 求职用户
    {path: '/jobseeker', name: 'jobseeker', component: LayoutUser
      ,redirect: '/jobseeker/umenu1',
      children: [
        {
          path: '/jobseeker/umenu1',
          name: 'umenu1',
          component: Umenu1
        },{
          path: '/jobseeker/umenu2',
          name: 'umenu2',
          component: Umenu2
        },{
          path: '/jobseeker/umenu3',
          name: 'umenu3',
          component: Umenu3
        },{
          path: '/jobseeker/umenu4',
          name: 'umenu4',
          component: Umenu4
        },{
          path: '/jobseeker/umenu5',
          name: 'umenu5',
          component: Umenu5
        },{
          path: '/jobseeker/personal-center',
          name: 'personal-center',
          component: PersonalCenter
        }
      ]
    },
    // hr用户
    {
      path: '/hr',
      name: 'hr',
      component: HrLoyout,
      redirect: '/hr/hmenu1',
      children: [
        {
          path: '/hr/hmenu1',
          name: 'hmenu1',
          component: Hmenu1
        },
        {
          path: '/hr/posManage',
          name: 'posManage',
          component: PosManage
        },
        {
          path: '/hr/hmenu3',
          name: 'hmenu3',
          component: Hmenu3
        },
        {
          path: '/hr/hmenu4',
          name: 'hmenu4',
          component: Hmenu4
        }
      ]
    },
    // 登录
    {
      path: '/',
      name: 'login',
      component: Login
    },
    // 注册
    {
      path: '/register',
      name: 'register',
      component: Register
    },
    // 管理员
    {
      path: '/admin',
      name: 'admin',
      component: Admin,
      redirect: '/admin/index',
      children: [
        {
          path: '/admin/index',
          name: 'adminIndex',
          component: AdminIndex
        },
        {
          path: '/admin/posReview',
          name: 'posReview',
          component: PosReview
        },
        {
          path: '/admin/posList',
          name: 'posList',
          component: PosList
        },
        {
          path: '/admin/user1',
          name: 'user1',
          component: User1
        },
        {
          path: '/admin/company1',
          name: 'company1',
          component: Company1
        },
        {
          path: '/admin/report',
          name: 'report',
          component: Report
        },
      ]
    }
  ]
})

export default router
